<template>
    <div>
        <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" @tab-change="handleChange">
            <el-tab-pane label="基础信息" name="1">
                <Baseinfo :app="route.query.app" />
            </el-tab-pane>
            <el-tab-pane label="升级" name="2">
                <el-card class="!border-none mb-4" shadow="never">
                    <span style="color:red;font-size:18px;font-weight:900;">
                        温馨提示：更新后需要按Ctrl+F5强制刷新页面后再使用
                    </span>
                </el-card>
                <Upgrade :app="route.query.app" v-if="yy == 0" />
                <Upgradecj :app="route.query.app" v-if="yy == 1" />
            </el-tab-pane>
            <el-tab-pane v-if="is_show == false" label="数据安全" name="3">
                <Datasecurity :app="route.query.app" />
            </el-tab-pane>
            <el-tab-pane label="更新日志" name="4">
                <Updatelog :app="route.query.app" />
            </el-tab-pane>
            <el-tab-pane label="提交bug" name="5"></el-tab-pane>
        </el-tabs>
    </div>
</template>


<script lang="ts" setup name="managementEdit">
import Baseinfo from "@/components/sys-upgrade/baseinfo.vue";
import Upgrade from "@/components/sys-upgrade/upgrade.vue";
import Upgradecj from "@/components/sys-upgrade/upgradecj.vue";
import Datasecurity from "@/components/sys-upgrade/data-security.vue";
import Updatelog from "@/components/sys-upgrade/update-log.vue";
import type { TabsPaneContext } from "node_modules/element-plus/es";
const route = useRoute();
const yy = ref()
const activeName = ref("1");

onMounted(async () => {
    if (route.query.app == undefined || !route.query.app) {
        return;
    }
    if (route.query.an != undefined && route.query.an) {
        activeName.value = "2";
    }
    // await getDetails()
    if (route.query.title == 1) {
        activeName.value = "2";
    }
});
const is_show = ref(true);
const handleClick = (tab: TabsPaneContext, event: Event) => {
    if (tab.paneName == 5) {
        window.open("https://support.qq.com/products/192748");
    }
};
const handleChange = (vv: any) => { };
const getLists = () => {
    is_show.value = route.query.app.includes("_");
    yy.value = route.query.yy
};
getLists();
</script>